<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			let days = ["星期天","星期一","星期二","星期三","星期四","星期五","星期六"]
			function show(){
				let current = new Date();//初始化一个日期
				let year = current.getFullYear()
				let month = format(current.getMonth()+1)
				let date = format(current.getDate())
				let hours = format(current.getHours())
				let minutes = format(current.getMinutes())
				let seconds = format(current.getSeconds())
				let day = days[current.getDay()]
				let str = `${year}-${month}-${date} ${hours}:${minutes}:${seconds} ${day}`
				document.querySelector("div").innerHTML = str
			}
			function format(num){
				if(num<10){
					num="0"+num
				}
				return num
			}
		</script>
	</head>
	<body>
		<div style="font-size: 32px; font-weight: 700;"></div>
		<script type="text/javascript">
			setInterval(show,1000)
		</script>
	</body>
</html>
